<?php 
//print_r( $_REQUEST );

include_once( ROOT . 'lib/vf.function.php'  );
include_once( ROOT . 'lib/biz.function.php'  );

check_user( 1 );

$id = ([$module_id]);

$fields = get_module_fields_by_id( $id );
check_form_input( get_meta_from_fields( $fields ) );

$_REQUEST['id'] = '__DY__NULL';
$_REQUEST['dy_uid'] = $_SESSION['dy_uid'];
$_REQUEST['dy_nickname'] = $_SESSION['dy_nickname'];
$_REQUEST['dy_addtime'] = '__DY__NOW';

$bad_word = _conf( 'WEB_SITE_BAD_WORD_LIST' ); 
if( !empty( $bad_word ) )
{
	if( is_in_list( join( ' ' , $_REQUEST ) , $bad_word ) )
	{
		info_page( '<br/><h3><a href="javascript:history.back(1)">您发布的文字包含敏感信息，为了不给' . _conf( 'WEB_SITE_NAME' ) . '和您带来不必要的麻烦。请修正您的内容</a></h3>');
		exit;
	}
}

$pda = new pda( 'dy_content_' . $id );
if($pda->insert())
{
	$tags = format_tags( $_REQUEST['dy_tags'] );
	if( !empty( $tags ) )
	{
		$cid = mysql_insert_id();
		add_related_tags( $id , $cid , $tags );
		add_tag( $id , $cid , $tags );
	}
		

	info_page( '<a href="?u=([$dy_module_en_name])_list">数据已经成功保存,点击这里返回列表</a>' );
	
	exit;
}

?>